import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * @author LKQ
 * @date 2021/12/13 19:44
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        String[] words = {"abcd","cdab","cbad","xyzz","zzxy","zzyx"};
        solution.numSpecialEquivGroups(words);
    }


    public int numSpecialEquivGroups(String[] words) {
        Set<String> seen = new HashSet();
        for (String S: words) {
            int[] count = new int[52];
            for (int i = 0; i < S.length(); ++i) {
                count[S.charAt(i) - 'a' + 26 * (i % 2)]++;
            }
            seen.add(Arrays.toString(count));
        }
        return seen.size();

    }

}
